package com.ruoyi.zhhq.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.zhhq.domain.Cantee;
import com.ruoyi.zhhq.mapper.CanteeMapper;
import com.ruoyi.zhhq.service.ICanteeService;

/**
 * 餐厅Service业务层处理
 * 
 * @author jieyiming
 * @date 2022-11-03
 */
@Service
public class CanteeServiceImpl implements ICanteeService 
{
    @Autowired
    private CanteeMapper canteeMapper;

    /**
     * 查询餐厅
     * 
     * @param restauranId 餐厅主键
     * @return 餐厅
     */
    @Override
    public Cantee selectCanteeByRestauranId(String restauranId)
    {
        return canteeMapper.selectCanteeByRestauranId(restauranId);
    }

    /**
     * 查询餐厅列表
     * 
     * @param cantee 餐厅
     * @return 餐厅
     */
    @Override
    public List<Cantee> selectCanteeList(Cantee cantee)
    {
        return canteeMapper.selectCanteeList(cantee);
    }
    
   

    /**
     * 新增餐厅
     * 
     * @param cantee 餐厅
     * @return 结果
     */
    @Override
    public int insertCantee(Cantee cantee)
    {
        cantee.setCreateTime(DateUtils.getNowDate());
        return canteeMapper.insertCantee(cantee);
    }

    /**
     * 修改餐厅
     * 
     * @param cantee 餐厅
     * @return 结果
     */
    @Override
    public int updateCantee(Cantee cantee)
    {
        cantee.setUpdateTime(DateUtils.getNowDate());
        return canteeMapper.updateCantee(cantee);
    }

    /**
     * 批量删除餐厅
     * 
     * @param restauranIds 需要删除的餐厅主键
     * @return 结果
     */
    @Override
    public int deleteCanteeByRestauranIds(String[] restauranIds)
    {
        return canteeMapper.deleteCanteeByRestauranIds(restauranIds);
    }

    /**
     * 删除餐厅信息
     * 
     * @param restauranId 餐厅主键
     * @return 结果
     */
    @Override
    public int deleteCanteeByRestauranId(String restauranId)
    {
        return canteeMapper.deleteCanteeByRestauranId(restauranId);
    }
}
